<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    let num = [2,5,8,3,7,6];
    for(let i=0;i<num.length-1;i++)
    {
        for(let j=0;j<num.length-1-i;j++)
        {
            
            if(num[j]>num[j+1])
            {
                let temp=0;
                temp=num[j+1];
                num[j+1]=num[j];
                num[j]=temp;
            }

        }

    }
console.log(num)

</script>
</html>